AmigaActive (155/1728)

From:paul
Date:4 Jun 2001 at 13:50:38
Subject:Re: Header Files (StormC v3)

--- In amigactive@y..., "David McMinn" <dave@b...> wrote:
> --- In amigactive@y..., David Bateman <iklett@h...> wrote:
> > when i use getch() all i get is a linker error: Symbol "_getch"
not
>
> Isn't getch() in conio.h, i.e. it's Windows/DOS specific.
> Can't help you with a replacement, I've been looking for some for
> ages, but never found any.

Yep, conio is a DOS include file. So I assume getch() is DOS too.

You can't really use getch() in AmigaDOS without resulting to non-
ANSI code. AmigaDOS CON: windows default to 'cooked' mode where the
input string is never passed to the application until enter (or EOF?)
is key pressed.

The way around this is to use 'raw' mode. There's a function in the
DOS library to switch between raw & cooked modes but I don't have the
RKMs with me at work so I can't tell you the name :)

After the console is in RAW mode you can use the regular AmigaDOS
file IO functions. You can get the filehandle with Output() / Input
().

What kind of program are you writing that needs raw input from the
CLI? Wouldn't it be much better to open a Window and get the input
from there?

p.s.
You can't normally go around using system header files from other
compilers/platforms.



Paul

Quote carefully and read all ADMIN:README mails

Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/